package cn.com.surker.enums.production;

import cn.com.surker.enums.ICodeDescEnum;
import cn.com.surker.enums.IDescription;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author lucky
 * @create 2022年10月04 7:02
 * @desc 生产合同类型
 */
public enum ProductionContractTypeEnum implements ICodeDescEnum {

    TRANSPORT(0,"运输合同"), PUMP(1,"泵送合同"),
    FUEL(2, "燃油合同"),DESIGN(4,"设计合同"), SALARY(5,"劳务合同"),
    OTHER(3,"其他"),PCYS(6,"PC运输合同"),
    ZL(7,"租赁合同");

    private final String description;

    private final Integer code;

    ProductionContractTypeEnum(Integer code, String description) {
        this.description = description;
        this.code = code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public Integer getCode() {return code;}

    public static Map<Integer, String> convertEnumToMap() {
        Map<Integer, String> map = new HashMap<>();
        for (ProductionContractTypeEnum type : ProductionContractTypeEnum.values()) {
            map.put(type.getCode(), type.getDescription());
        }
        return map;
    }
}